import logging

from config import BASE_HOST


class TenderApi:
    # 获取session对象
    def __init__(self, session):
        self.session = session

    # 投资接口
    def tender(self, body):
        url = BASE_HOST + '/trust/trust/tender'
        resp = self.session.post(url=url, data=body)
        logging.info(f'投资接口:{resp.json()}')
        return resp

    # 第三方投资接口
    def third_tender(self, url, body):
        resp = self.session.post(url=url, data=body)
        logging.info(f'第三方投资接口:{resp.status_code}')
        return resp
